﻿namespace XxlJobDotNetCore.Services
{
    /// <summary>
    /// 用基础的HttpClient实现的Service,可以实现更多的操作
    /// </summary>
    public class TestJobService
    {
        private ILogger _logger;
        private readonly RequestBase.HttpRequest _request;
        public TestJobService(ILogger<TestJobService> logger, RequestBase.HttpRequest request)
        {
            _logger = logger;
            _request = request;
        }
        /// <summary>
        /// 测试 Job方法
        /// </summary>
        /// <returns></returns>
        public string Test(string testStr)
        {
            _logger.LogInformation($"测试Job执行！{testStr}");
            return "Test Job Success.";
        }
        /// <summary>
        /// 停车场项目
        /// </summary>
        /// <returns></returns>
        public async Task<string> SmartParkingSync()
        {
           var req= await _request.GetAsync("zongyu1119/smart-parking");
            _logger.LogInformation(req);
            return req.ToString();
        }
        /// <summary>
        /// 前端提示
        /// </summary>
        /// <returns></returns>
        public async Task<string> ZyAlertSync()
        {
            var req = await _request.GetAsync("zongyu1119/zyalert");
            _logger.LogInformation(req);
            return req.ToString();
        }
      
    }
}
